Skip to main content

Creating a New Profile

New command-and-control profiles for Apollo should be new projects under the Apollo solution. Your new project should be named C2ChannelProfile, where C2Channel is the means through which the profile will talk to Mythic. For example, if this profile communicates over HTTP, the project name will be HttpProfile. If it would communicate over web sockets, the name should be WebSocketProfile. This project should be a .NET Framework 4.0 Class library. In your new project, create a class that has the same name as your project (e.g., public class C2ChannelProfile). This class should inherit from the C2Profile abstract class and the IC2Profile interface. The constructor of your new C2 profile will take the following parameters:
  • Dictionary parameters - C2 Profile specific parameters. For example, things like jitter, urls, host headers, etc. would all be passed via key-value pairs in this dictionary.
  • ISerializer serializer - This object is used to prepare C# structures into a serialized format that Mythic will receive, and allow the profile to deserialize JSON messages from Mythic into Apollo structures. Currently this variable should not be modified in the agent core.
  • IAgent agent - Core Apollo agent interface that grants the C2 profile access to other parts of the agent, such as the task manager.
The new C2 profile should implement the IC2Profile interface, which is as follows:

Adding Your Profile to Apollo Core

Once you’ve created your new C2 profile, you’ll need to add it to Apollo as a build option for C2 profiles. In the Apollo project under the Apollo solution, add your new C2 profile as a project reference. Then, at the top of the Apollo/Config.cs file, add the following lines:
Lastly, in the EgressProfiles dictionary, add a new entry for your C2 profile. It shoudl be of the format:
To debug your C2 Profile, simply fill in the parameter values in the DEBUG block of your parameters, and add at the top of the file #define C2CHANNEL in the #if DEBUG block.

Add to Builder.py

Lastly, you’ll need to modify the builder.py file under Payload_Type/apollo/mythic/agent_functions. In that file, add your new profile to the c2profiles attribute under Apollo.